<extend name="Public:template" />
<block name="page_body">
<!-- 购物车页面  -->
<header class="headerSub clearfix">
    <h2>确认订单</h2>
    <a href="{:U('Cart/index')}" class="backBtn leftBtn" >返回修改</a>
    <a href="{:U('Product/index')}" class="rightBtn yellowNorBg">继续购物</a>
</header>
<div class="content">
	<!-- 配送信息 -->
	<div class="listFormBox clearfix">
		<dl id="address" class="itemFormBox">
			<dt class="greenGraBg"><span class="fl">配送地址</span><span class="fr" style="width:50px;">选择</span></dt>  
			<dd class="<notempty name='list'>none</notempty>">
				<span id="msg_info_add" class="errHolder" style="display:none;"></span>
				<form action="{:U('CustOrder/doOrder')}" method="post" name="form_add" id="form_add">
					<input type="hidden" name="address_add_flag" value="{$address.add_flag}">
					<ul class="inputBox">
						<li><input  name="cust_name" type="text" class="inputIconUser" placeholder="收货人" value="{$address.name}"/> </li>
						<li><input  name="cust_mobile" type="number" class="inputIconUser" placeholder="联系方式（手机或电话）" value="{$address.mobile}" /></li>
						<li><input  name="cust_address" type="text" class="inputIconPwd" placeholder="请填写配送地址" value="{$address.address}"/></li>
						<li style="background:#fff">
							<select name="cust_free_time" style="width:100%;font-size:26px;vertical-align:middle;">
								<option value="立刻">立刻送</option>
								<option value="早间	08：00-10：00">早间	08：00-10：00</option>
								<option value="中午	11：00-13：00">中午	11：00-13：00</option>
								<option value="下午	14：00-17：00">下午	14：00-17：00</option>
								<option value="傍晚	18：00-20：00">傍晚	18：00-20：00</option>
								<option value="其它">其它	备注中说明</option>
							</select>
						</li>
						<li><input  name="cust_bak" type="text" class="inputIconPwd" placeholder="备注信息" value="{$address.content}"/></li>
					</ul>
				</form>
			</dd>
		</dl>
	</div>
	<!-- 商品清单 -->
	<div class="listContentBox clearfix">
		<h2 class="yellowGraBg">商品清单</h2>
		<volist name="cartItems" id="val">
		<dl id="{$val.prod_id}" class="itemContentBox">
			<dd class="">
				<p>{$i}.{$val.name} {$val.spec|m_prod_spec=$val['spec_qty'],$val['spec_unit']}</p>
				<p class="fr">
					<span >¥{$val.price_real}&nbsp&nbsp</span>
					<span class="deepRed" style="font-weight:700;font-size:14px;">×{$val.num}</span>
				</p>
			</dd>
		</dl>
		</volist>
	</div>
	
	<div class="cartBottomContainer">
	<!--统计信息-->
	<div class="cartTotal">
		<p class="alignR" id="suminfo">
			您购买了<span class="deepRed" >{$cartPrice.total_item}</span>种商品，总共<span class="deepRed" >{$cartPrice.total_num}</span>件，商品总价：<span class="deepRed" id="totalpricespan">¥{$cartPrice.total_amt|number_format=###, 2,'.',''}</span>
    	</p>
    	<p class="alignR">
			<if condition="$address['fee'] == 0">
	   			免费配送
	   		<else/>
	   			配送费用：<span class="deepRed">¥{$cartPrice.send_fee|number_format=###, 2,'.',''}</span>
	   		</if>
    	</p>
	</div>
	<if condition="$cartPrice.total_amt gt 0">
		<!--操作按钮-->
		<ul class="linkBtnBox" style="padding-top:10px;">
			<li class="linkBtnBoxFull"><a href="#" id="doOrderBtn" class="linkBtn blueNorBg" >提交订单</a></li>
		</ul>
	</if>
</div>
</block>
<block name="script_footer">
<script type="text/javascript">
$(document).ready(function(){
	$("#doOrderBtn").on("click",function(){
		var formObj = document.forms["form_add"];
		var formElsObj = formObj.elements;
		if(formElsObj['cust_name'].value==''){
			alert('收货人名称不能为空');
			return false;
		}
		if(formElsObj['cust_mobile'].value==''){
			alert('联系电话或手机不能为空');
			return false;
		}
		if(formElsObj['cust_address'].value==''){
			alert('配送地址不能为空');
			return false;
		}
		formObj.submit();
	})
})
</script>
</block>